<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        document.addEventListener('keyup', function(e) {
            //1.keyup和keydown 事件都不区分大小写 都得到 ASCII 码 65
            console.log('up:' + e.keyCode);
        })
        
        document.addEventListener('keypress', function(e) {
            //2.keypress 区分大小写
            console.log('press:' + e.keyCode);
        })
    </script>
</body>
</html>